package com.ruoyi.factorydata.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.factorydata.mapper.InventoryReceiptDetailMapper;
import com.ruoyi.factorydata.domain.InventoryReceiptDetail;
import com.ruoyi.factorydata.service.IInventoryReceiptDetailService;

/**
 * 入库单详情Service业务层处理
 *
 * @author ruoyi
 * @date 2025-07-21
 */
@Service
public class InventoryReceiptDetailServiceImpl extends ServiceImpl<InventoryReceiptDetailMapper, InventoryReceiptDetail> implements IInventoryReceiptDetailService {
    @Autowired
    private InventoryReceiptDetailMapper inventoryReceiptDetailMapper;

    /**
     * 查询入库单详情
     *
     * @param id 入库单详情主键
     * @return 入库单详情
     */
    @Override
    public InventoryReceiptDetail selectInventoryReceiptDetailById(Long id) {
        return inventoryReceiptDetailMapper.selectInventoryReceiptDetailById(id);
    }

    /**
     * 查询入库单详情列表
     *
     * @param inventoryReceiptDetail 入库单详情
     * @return 入库单详情
     */
    @Override
    public List<InventoryReceiptDetail> selectInventoryReceiptDetailList(InventoryReceiptDetail inventoryReceiptDetail) {
        return inventoryReceiptDetailMapper.selectInventoryReceiptDetailList(inventoryReceiptDetail);
    }

    /**
     * 新增入库单详情
     *
     * @param inventoryReceiptDetail 入库单详情
     * @return 结果
     */
    @Override
    public int insertInventoryReceiptDetail(InventoryReceiptDetail inventoryReceiptDetail) {
                inventoryReceiptDetail.setCreateTime(DateUtils.getNowDate());
            return inventoryReceiptDetailMapper.insertInventoryReceiptDetail(inventoryReceiptDetail);
    }

    /**
     * 修改入库单详情
     *
     * @param inventoryReceiptDetail 入库单详情
     * @return 结果
     */
    @Override
    public int updateInventoryReceiptDetail(InventoryReceiptDetail inventoryReceiptDetail) {
                inventoryReceiptDetail.setUpdateTime(DateUtils.getNowDate());
        return inventoryReceiptDetailMapper.updateInventoryReceiptDetail(inventoryReceiptDetail);
    }

    /**
     * 批量删除入库单详情
     *
     * @param ids 需要删除的入库单详情主键
     * @return 结果
     */
    @Override
    public int deleteInventoryReceiptDetailByIds(Long[] ids) {
        return inventoryReceiptDetailMapper.deleteInventoryReceiptDetailByIds(ids);
    }

    /**
     * 删除入库单详情信息
     *
     * @param id 入库单详情主键
     * @return 结果
     */
    @Override
    public int deleteInventoryReceiptDetailById(Long id) {
        return inventoryReceiptDetailMapper.deleteInventoryReceiptDetailById(id);
    }
}